# 1.单线程
# 【2.多线程】
# 3.资源共享与竞争

import time
from threading import Thread, Lock, current_thread


def funa(a):
    print(f'开始{a}')
    time.sleep(5)
    print(f'结束{a}')

def funb(b1, b2):
    print(f'开始{b1}')
    time.sleep(5)
    print(f'结束{b2}')

def func(*c1):
    print(f'开始{c1}')
    time.sleep(5)
    print(f'结束{c1}')

def fund(*d1, d2):
    print(f'开始{d1}')
    time.sleep(5)
    print(f'结束{d2}')

def fune(e1, *e2):
    print(f'开始{e1}')
    time.sleep(5)
    print(f'结束{e2}')

def funf(f1,**f2):
    print(f'开始{f1}')
    time.sleep(5)
    print(f'结束{f2}')

def fung(*g1,**g2):
    print(f'开始{g1}')
    time.sleep(5)
    print(f'结束{g2}')



# 设置守护线程 当守护线程结束 其他线程也结束
if __name__ == '__main__' :
    # ta = Thread(target=funa, args=('a',))
    # ta.start()
    #
    # tb = Thread(target=funb, args=('b1', 'b2'))
    # tb.start()
    #
    # tc = Thread(target=func, args=('c1', 'c2'))
    # tc.start()

    # td = Thread(target=fund,args=('d1','d3'), kwargs={'d2': 'd2'})
    # td.start()

    # te = Thread(target=fune, args=('e1', ('e2','e3')))
    # te.start()

     # tf = Thread(target=funf, kwargs={'f1':'f1','f2':'f2','f3':'f3'})
     # tf.start()

    tg = Thread(target=fung, args=('g1', 'g4'), kwargs={'f1': 'f1', 'f2': 'f2', 'f3': 'f3'})
    tg.start()














